CC = c++

CFLAGS = -Wall -g

SOURCES = \
BufferedSocket.cpp \
CoreException.cpp \
Countdown.cpp \
DataField.cpp \
DateTime.cpp \
DFNative.cpp \
FixedFSpec.cpp \
FSpec.cpp \
InternetAddress.cpp \
Log.cpp \
LogFile.cpp \
Mutex.cpp \
Random.cpp \
RawData.cpp \
Signal.cpp \
Socket.cpp \
Synchronizer.cpp \
System.cpp \
SystemLogFile.cpp \
TCPServer.cpp \
Telnet.cpp \
Thread.cpp \
ThreadManager.cpp \
Timer.cpp \
TimeSpan.cpp \

PCH = stdafx.h.gch

OBJECTS = $(SOURCES:.cpp=.o)

OUTPUT = Core.a

all : $(PCH) $(SOURCES) $(OUTPUT)

$(PCH) : stdafx.h
	$(CC) -c stdafx.h $(CFLAGS)

.cpp.o :
	$(CC) -c $< $(CFLAGS) -o $@

$(OUTPUT) : $(OBJECTS)
	ar -r $(OUTPUT) $^
	cp $(OUTPUT) ../lib/

.PHONY : clean

clean :
	rm -rf *.o *.gch $(OUTPUT)
